package com.sixth.controller;

import com.sixth.entity.Goods;
import com.sixth.entity.Limit;
import com.sixth.entity.Staff;
import com.sixth.entity.Warehousings;
import com.sixth.service.AuditService;
import com.sixth.util.CommonResult;
import com.sixth.util.LayTab;
import com.sixth.util.TableLayUi;
import javafx.scene.chart.PieChart;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @program: project01
 * @description:
 * @author: 老魏
 * @create: 2021-12-18 15:21
 **/
@RestController
@RequestMapping("/audit")
public class AuditController {
    @Autowired
    private AuditService auditService;

    public  AuditController(){
    }
    @RequestMapping("/updateStatus")
    public CommonResult updateStatus(Integer id, Integer status, Date dates){
        CommonResult result = auditService.updateStatus(id, status,new Date());
        return  result;
    }

    @RequestMapping("/updateStatuses")
    public  CommonResult updateStatuss(Integer id ,Integer status,Date dates,String msg){
        CommonResult result= auditService.updateStatuses(id,status,dates,msg);
        return  result;
    }
    @RequestMapping("/update")
    public  CommonResult update(Integer id, Integer status){
        CommonResult update = auditService.update(id,status);
        return  update;
    }
    @RequestMapping({"getAllWarehousings"})
    public LayTab getAllWarehousings(Staff staff, Warehousings warehousings, Integer id) {
        LayTab allWarehousings = auditService.getAllWarehousings(staff, warehousings, id);
        return allWarehousings;
    }

    @RequestMapping({"getAllShoping"})
    public LayTab getAllShoping(Goods goods, Limit limit) {
        LayTab allShoping = auditService.getAllShoping(goods, limit);
        return allShoping;
    }

}
